package com.thiswhyme.fsplus;

import com.thiswhyme.fsplus.sentinel.feign.defaultdegrade.BaseDegradeProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @description: fs工具自动配置属性
 * @author: thiswhyme
 * @date: 2021/4/30
 */
@ConfigurationProperties(prefix = "feign.sentinel.fsplus")
public class FeignSentinelPlusProperties {

    /**
     * 是否开启默认fallback
     */
    private Boolean defaultFallbackEnabled = false;

    /**
     * 是否开启ip:port（实例）级别资源声明
     */
    private Boolean ipSourceEnabled = false;

    /**
     * 是否开启实例过滤，开启后触发熔断时不抛出block异常，而是将当前实例从ribbon的负载均衡中剔除，窗口期后恢复，默认false
     */
    private Boolean instanceFilterEnabled = false;

    /**
     * 兜底降级配置属性
     */
    private BaseDegradeProperties baseDegrade;

    public Boolean getDefaultFallbackEnabled() {
        return defaultFallbackEnabled;
    }

    public void setDefaultFallbackEnabled(Boolean defaultFallbackEnabled) {
        this.defaultFallbackEnabled = defaultFallbackEnabled;
    }

    public Boolean getIpSourceEnabled() {
        return ipSourceEnabled;
    }

    public void setIpSourceEnabled(Boolean ipSourceEnabled) {
        this.ipSourceEnabled = ipSourceEnabled;
    }

    public Boolean getInstanceFilterEnabled() {
        return instanceFilterEnabled;
    }

    public void setInstanceFilterEnabled(Boolean instanceFilterEnabled) {
        this.instanceFilterEnabled = instanceFilterEnabled;
    }

    public BaseDegradeProperties getBaseDegrade() {
        return baseDegrade;
    }

    public void setBaseDegrade(BaseDegradeProperties baseDegrade) {
        this.baseDegrade = baseDegrade;
    }
}
